import { jsx as _jsx } from "react/jsx-runtime";
import { useState, useRef, forwardRef, useImperativeHandle, } from "react";
import { DevPopup } from "~/public/cpas-ui";
export const LogicPopup = forwardRef((props, ref) => {
    const [visible, setVisible] = useState(false);
    const diaParams = useRef();
    // 自定义方法
    useImperativeHandle(ref, () => ({
        show: async (params) => {
            diaParams.current = params;
            setVisible(true);
        },
    }));
    return (_jsx("div", { children: _jsx(DevPopup.Logic, { ref: ref, width: 400, height: 200, visible: visible, title: diaParams.current?.title, okText: "\u662F", cancelText: "\u5426", onOK: () => {
                setVisible(false);
                if (diaParams.current?.okCallback) {
                    diaParams.current?.okCallback();
                }
            }, 
            // cancelDisabled
            onCancel: () => {
                setVisible(false);
            }, onHiding: () => {
                setVisible(false);
            }, children: () => {
                return _jsx("span", { children: "\u8BE5\u6A21\u677F\u5DF2\u5B58\u5728,\u662F\u5426\u8986\u76D6\uFF1F" });
            } }) }));
});
export default LogicPopup;
